# $Id: PKGBUILD 179953 2013-03-13 11:55:18Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=bcprov
pkgver=1.48
pkgrel=1
pkgdesc="Java cryptography APIs (Bouncy Castle)"
arch=('any')
url="http://www.bouncycastle.org/java.html"
license=('custom')
depends=('java-runtime')
makedepends=('java-environment' 'junit')
source=("http://www.bouncycastle.org/download/bcprov-jdk15on-${pkgver/./}.tar.gz")
md5sums=('ac662124410ffef3686bd936530e758d')

build() {
  cd "${srcdir}/bcprov-jdk15on-${pkgver/./}"
  jar xf src.zip

  mkdir classes
  find . -name '*.java' > src.list
  javac -encoding ISO-8859-1 -cp /usr/share/java/junit.jar -d classes @src.list

  cd classes
  find . -path '*test/*.class' -delete
  find . -depth -type d -empty -delete
  install -m644 ../org/bouncycastle/x509/*.properties org/bouncycastle/x509/
  jar cf ../bcprov.jar *
}

package() {
  cd "${srcdir}/bcprov-jdk15on-${pkgver/./}"
  install -m755 -d "${pkgdir}/usr/share/java"
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 bcprov.jar "${pkgdir}/usr/share/java/"
  install -m644 LICENSE.html "${pkgdir}/usr/share/licenses/${pkgname}/"
}
